package com.example.mplayer;

import java.util.ArrayList;
import java.util.List;

import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.widget.Adapter;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.SimpleAdapter;

public class MainActivity extends Activity {
	private ListView mListView;
	private ArrayAdapter<String> maAdapter;
	private ArrayList<String> mList;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
		init();
		mListView.setAdapter(maAdapter);
	
	}
	public void init(){
		mListView = (ListView) findViewById(R.id.mlistview);
		mList = new ArrayList<String>();
		for(int i = 0;i < 5;i++)
		{
			mList.add("苹果"+i);
		}
		maAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, mList);
	}
 
}
